﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="WebGuiMvc.Models" %>
<table>
    <% if (ViewData["EventPropertiesHtml"] == null)
       {
    %>
    Choose event type
    <%
        }
       else
       {
    %>
    <%= ViewData["EventPropertiesHtml"] %>
    <tr>
        <td colspan="2">
            <table>
                <tr>
                    <td align="center">
                        Place
                    </td>
                </tr>
                <tr>
                    <td>
                        Choose
                        <%= Html.ActionLink("new", MVC.Event.AddNewPlace(), new { @class="example5"}) %>
                        or <a href="#" class="example8">previously labeled</a> place
                        <script type="text/javascript">
                            $('.example5').colorbox();
                            $('.example8').colorbox({ inline: true, href: '#previouslyAddedPlacesDiv' });
                        </script>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table id="placeDataTable">
                            <tr>
                                <td>
                                    City
                                </td>
                                <td id="cityNameTd">
                                    <%= PropertiesHelper.PrintIfDefined(ViewData["CityName"] as string) %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Place type
                                </td>
                                <td id="placeTypeTd">
                                    <%= PropertiesHelper.PrintIfDefined(ViewData["PlaceTypeName"] as string) %>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Place name
                                </td>
                                <td id="placeNameTd">
                                    <%= PropertiesHelper.PrintIfDefined(ViewData["PlaceName"] as string) %>
                                </td>
                            </tr>
                            <tr style="display: none">
                                <%= Html.Hidden("cityUri", ViewData["CityUri"]) %>
                                <%= Html.Hidden("placeTypeUri", ViewData["PlaceTypeUri"]) %>
                                <%= Html.Hidden("placeUri", ViewData["PlaceUri"]) %>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <%
        }
    %>
</table>

<% if (ViewData["EventId"] == null)
   {
%>
<script type="text/javascript">
    var placeDataTable = $('#placeDataTable');
    if (placeDataTable != null)
        placeDataTable.ready(function () {
            setPlace('', '', '', '', '', '', '');
        });
</script>
<%
    }
%>